package cn.ilovese.collect.vo.collaboration_task;

import cn.ilovese.collect.po.task.Task;
import cn.ilovese.collect.vo.Device.DeviceRequirementVO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
public class SubTaskVO{
    private String username;

    private Integer id;

    private Integer userId;

    private String taskname;

    private String description;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date deadline;

    private Integer total_num;

    private Integer need_num;

    private String type;

    private String environment;

    private DeviceRequirementVO deviceRequirement;

    private Boolean capableToClaim;

    private Integer reportPrice;

    List<Integer> dependencies;

    public SubTaskVO(Task task, String username){
        id=task.getId();
        userId=task.getUserId();
        taskname=task.getTaskName();
        description=task.getDescription();
        startTime = task.getStartTime();
        deadline = task.getEndTime();
        total_num = task.getTotalNumber();
        need_num  = task.getNeedNumber();
        type = task.getType();
        environment = task.getEnvironment();
        reportPrice=task.getReportPrice();
        setUsername(username);
    }

    public SubTaskVO(){

    }
}